<template>
	<view class="main">
		<!-- topBar -->
		<lawBankTopBar :backgroundUrl="backgroundUrl" :title="title"></lawBankTopBar>
		<view class="content1">
			<scroll-view class="show_content" style="height: calc(100vh - 460rpx);" :scroll-y="true" :scroll-top="scrollTop">
				<view class="search_item">
					<view class="title">标题关键字</view>
					<u-search placeholder="请输入关键字" :showAction="false" shape="square" height="70rpx" searchIconSize="0"
						v-model="form.keyword" :clearabled="false" @change="getData"></u-search>
				</view>
				<view class="search_item">
					<view class="title">全文关键字</view>
					<u-search placeholder="请输入关键字" :showAction="false" shape="square" height="70rpx" searchIconSize="0"
						v-model="form.cons_keyword" :clearabled="false" @change="getData"></u-search>
				</view>
				<view class="search_item dispatch">
					<view class="title">发文字号</view>
					<view class="search_typeSize">
						<view class="typeSize1" style="width: 200rpx;">
							<u-search placeholder="国家税务总局公告" :showAction="false" shape="square" height="70rpx" searchIconSize="0"
								v-model="form.zh_keyword" :clearabled="false" @change="getData"></u-search>
						</view>
						<view class="year">
							<span class="kuohao">〔 </span>
							<view>
								<u-search placeholder="2023" :showAction="false" shape="square" height="70rpx" searchIconSize="0"
									v-model="form.zh_year" inputAlign="right" :clearabled="false" @change="getData"></u-search>
							</view>
							<span class="kuohao"> 〕</span>年
						</view>
						<view class="typeSize2">
							<u-search placeholder="1" :showAction="false" shape="square" height="70rpx" searchIconSize="0"
								v-model="form.zh_no" inputAlign="right" :clearabled="false" @change="getData"></u-search>号
						</view>
					</view>
				</view>






				<view class="search_item">
					<view class="title">地区</view>
					<biaofun-region-two-level-all @change1="selectRegion" @changes1="regionsCancel">
						<view class="district">
							<u-search v-model="shengshiquTxt.name" placeholder="请选择地区" :showAction="false" shape="square" height="70rpx"
								searchIconSize="0" disabled :clearabled="false" @change="getData">
							</u-search>
							<u-icon class="arrow_down" name="arrow-down" color="#1c87f3" size="23"></u-icon>
						</view>
					</biaofun-region-two-level-all>
				</view>






				<view class="search_item">
					<view class="title">税种</view>
					<picker :range="taxTypeList" range-key="name" @change="categoryChange" @cancel="categoryCancel">
						<view class="district">

							<u-search v-if="taxTypeIndex >= 0" v-model="taxTypeList[taxTypeIndex].name" placeholder="请选择税种"
								:showAction="false" shape="square" height="70rpx" searchIconSize="0" disabled :clearabled="false"
								@change="getData">
							</u-search>
							<u-search v-else placeholder="请选择税种" :showAction="false" shape="square" height="70rpx" searchIconSize="0"
								disabled :clearabled="false" @change="getData">
							</u-search>
							<u-icon class="arrow_down" name="arrow-down" color="#1c87f3" size="23"></u-icon>
						</view>
					</picker>
				</view>

				<view class="search_item">
					<view class="title">发文日期</view>
					<view class="search_item_date">
						<u-search v-model="form.startDate" placeholder="开始日期" :showAction="false" shape="square" height="70rpx"
							searchIconSize="0" :disabled="true" :clearabled="false" @click="openDatetimePicker(1)">
						</u-search>
						<view class="line"></view>
						<u-search v-model="form.endDate" placeholder="结束日期" :showAction="false" shape="square" height="70rpx"
							searchIconSize="0" disabled :clearabled="false" @click="openDatetimePicker(2)">
						</u-search>
					</view>
				</view>

				<view class="search_item">
					<view class="title">效力注释</view>
					<picker :range="potencyList" range-key="id" @change="potencyChange" @cancel="potencyCancel">
						<view class="district">
							<u-search v-model="form.xiaoli_id" placeholder="请选择效力" :showAction="false" shape="square" height="70rpx"
								searchIconSize="0" disabled :clearabled="false" @change="getData">
							</u-search>
							<u-icon class="arrow_down" name="arrow-down" color="#1c87f3" size="23"></u-icon>
						</view>
					</picker>
				</view>
			</scroll-view>
			<view class="search_footer">
				<view class="footer_left">
					<text class="search_before" v-if="!flag">请选择查询条件</text>
					<text class="search_after" v-else>已找到<text style="color: #FA5151;">{{ count }}</text>条结果</text>
				</view>
				<view class="footer_right">
					<view class="btn reset" v-if="flag" @click="reset">重置</view>
					<view class="btn checkBtn" @click="goData">查一下</view>
				</view>
			</view>
		</view>


		<!-- 发文开始结束时间 -->
		<u-datetime-picker ref="datetimePicker" :formatter="formatter" :show="showDateTime" v-model="value1" mode="date"
			@cancel="cancelDateTime" @confirm="confirmDateTime"></u-datetime-picker>
	</view>
</template>

<script type="text/javascript" src="plus-confusion://../lawBank/highSearch/highSearch"></script>

<style lang="scss">
.main {
	background: #fff;

	.content1 {
		width: 100%;
		position: relative;
		z-index: 10;
		margin-top: -32rpx;
		background: #fff;
		border-radius: 40rpx;
		padding: 30rpx;
		box-sizing: border-box;

		.search_item {
			.title {
				line-height: 28px;
				margin-top: 28rpx;
				margin-bottom: 15rpx;
				font-size: 26rpx;
				font-weight: 600;
			}

			.search_typeSize {
				display: flex;
				align-items: center;

				.typeSize1 {
					flex: 2;
					display: flex;
					align-items: center;
				}

				.typeSize2 {
					flex: 1;
					display: flex;
					align-items: center;
				}

				.year {
					flex: 2;
					display: flex;
					align-items: center;
				}
			}

			.dispatch {
				display: flex;
				align-items: center;
				font-size: 32rpx;
			}

			.district {
				width: 100%;
				position: relative;

				.arrow_down {
					position: absolute;
					top: 50%;
					right: 20rpx;
					transform: translateY(-50%);
				}
			}

			.search_item_date {
				display: flex;

				.line {
					width: 20rpx;
				}
			}
		}

		.search_footer {
			padding: 30rpx;
			box-sizing: border-box;
			width: 100%;
			position: fixed;
			bottom: 0;
			left: 0;
			display: flex;
			align-items: center;
			justify-content: space-between;
			background: #fff;
			z-index: 999999999999;

			.footer_left {
				font-size: 30rpx;

				.search_before {
					color: #B3B3B3;
				}

				.search_after {
					color: #333;
				}
			}

			.footer_right {

				display: flex;
				align-items: center;

				.btn {
					width: 176rpx;
					height: 76rpx;
					text-align: center;
					line-height: 76rpx;
					border-radius: 38rpx;
				}

				.reset {
					border: 1rpx solid #1C87F3;
					color: #1C87F3;
					margin-right: 20rpx;
				}

				.checkBtn {
					background: #1C87F3;
					color: #fff;
				}

				.checkBtnDisable {
					background: #8CC5FC;
					color: #fff;
				}
			}
		}
	}
}

/deep/.u-search__content {
	padding: 0 !important;
}
</style>
